<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>班级通知</title>
<link rel="stylesheet" href="/scriptZIP/layui.min.css">
	<link rel="stylesheet" href="../css/radio.css">
	<link rel="stylesheet" href="../css/layui.css" />
	<link rel="stylesheet" href="../css/item.css">
	<style>
		#portrait {
			width: 100px;
			height: 100px;
			border: 1px solid #ddd;
		}

		.layui-row {
			margin-top: 50px;
		}

		.layui-textarea {
			min-height: 200px !important;
		}
	</style>
</head>

<body>
	

	<form id="form" method="post" ref="form" enctype="multipart/form-data" style="display: none">
		<input type="file" id="file" name="file" accept="image/*">
	</form>


	<div class="layui-row" id="vue-root">
		<div class="layui-col-md6 layui-col-md-offset3">
			<div class="layui-form-item">
				<label class="layui-form-label">标题</label>
				<div class="layui-input-block">
					<input name="noticeName" v-validate="'required'" data-vv-as="标题" autocomplete="off"
						placeholder="请输入通知标题" class="layui-input name" v-model="item.title">
					<div class="checkout_state" v-text="err('noticeName')"></div>
				</div>

			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">发布者</label>
				<div class="layui-input-block">
					<input name="noticePublisher" v-validate="'required'" data-vv-as="发布者" autocomplete="off"
						placeholder="请输入通知发布者" class="layui-input teachername" v-model="item.publisher">
					<div class="checkout_state" v-text="err('noticePublisher')"></div>
				</div>

			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">面向对象</label>
				<div class="layui-input-block" style="padding-top: 13px;line-height: 15px;">
					<input type="radio" name="num" :value="0" title="全校师生" v-model="item.receiver">
					<span>全校师生</span>
					<input type="radio" name="num" :value="1" title="全体教师" v-model="item.receiver"
						style="margin-left: 20px;">
					<span>全体教师</span>
					<input type="radio" name="num" :value="2" title="全体学生" v-model="item.receiver"
						style="margin-left: 20px;">
					<span>全体学生</span>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">内容</label>
				<div class="layui-input-block" style="width: 150%;">
					<editor :init="init1" v-model="item.content" />
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">发微信推送并在微信端显示</label>
				<div class="layui-input-block teachertitle" style="padding-top: 13px;line-height: 15px;">
					<input name="checkbox" type="checkbox" class="checkbox" v-model="item.show" />
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<div class="offer" @click="submit">立即提交</div>
					<div class="return" onclick="history.back()">取消</div>
				</div>
			</div>
		</div>
	</div>
	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	
	
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/scriptZIP/dayjs.min.js"></script>

	<script src="/scriptZIP/dayjs.min.js"></script>


	<script src="/scriptZIP/tinymce.min.js"></script>
	<script src="/lib/tinymce-vue.min.js"></script>
	<script src="/js/tinymce_image_plugin.js"></script>

	<script src="/lib/laydate/laydate.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/item.js"></script>

	<script>

		var schoolId = top_params().id;
		var field = 'notice';

		var app = new Vue(merge({
			components: {
				editor: Editor
			},
			data: {
				item: {
					receiver: 0,
					schoolId: schoolId,
					show: true,
					content: ''
				},
				url: '/pc/notice',
				init1: tinymceInit
			},
			methods: {
				fillData: function () {
					this.item.text = getText(this.item.content);
					this.item.hide = !this.item.show;
				},
			},
			watch: {
				'item.content': function (nv, ov) {
					replaceImg(this.item, 'content');
				}
			}
		}));
	</script>
</body>

</html>